<?php

namespace App\Http\Controllers\Desktop;

use App\Jobs\QueuedTest;
use Illuminate\Http\Request;

use Crypt;
use Auth;
use App\Jobs\ChangeLocale;
use Illuminate\Support\Facades\Queue;

class HomeController extends FrontController
{

    /**
     * YASCMF index
     */
    public function getIndex()
    {
        //-------------------------队列----------------------------
//        //消息生成
//        $this->dispatch(new QueuedTest());
//        //消息获取
//        $queue = app('queue');
//        $job = $queue->pop();
////        $job = Queue::pop();
//        $job->fire();
        //-------------------------HTTP----------------------------
//        $html = file_get_contents('http://www.baidu.com');
//        dump($http_response_header);
//        $fp = fopen('http://www.baidu.com','r');
//        dump(stream_get_meta_data($fp));
        //-------------------------HTTP----------------------------
//        $arr = [
//            '数据'=>'112121212',
//            '的'=>'反对反对法地方',
//        ];
//        $data = http_build_query($arr);
//        dump($data);
        return view('desktop.index');
    }


    /**
     * Change Language
     */
    public function getLang(ChangeLocale $changeLocale)
    {
        $this->dispatch($changeLocale);

        return redirect()->back();
    }

}
